import store from "@/store"

export const validatePhoneNumber = value => {
  let regPhone = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
  return regPhone.test(value)
}

export const useToast = (msg, status, time=1500) => {
  store.commit('toastStatus/setIsShowToast', {
    isShow: true,
    msg,
    status
  })
  setTimeout(() => {
    store.commit('toastStatus/setIsShowToast', {
      isShow: false,
      msg,
      status
    })
  }, time)
}